#pragma once
#include "cocos2d.h"
#include "cocos-ext.h"
#include "cocos/network/HttpClient.h"
USING_NS_CC;
using namespace network;

class CPostMsg
	:public cocos2d::Ref
{
public:
	CPostMsg(void);
	~CPostMsg(void);
	void PostLoginCheck(const char* szUser,const char* szPassWord);
	void PostFight(int iAttAccId,int iRecAccId);
	void PostFightingInfo(const char* szRandomCode,SEL_CallFuncND pSelector,Ref *pThis);

protected:
	void Post(char* szUrl,char* szPostData,char*pTag,SEL_CallFuncND pSelector=nullptr,Ref *pThis=nullptr);
	void PostCallBack(cocos2d::Node *sender ,void *data);

	void OnResult(__String szTag,__String* pszJson);
	void OnResult_LoginCheck(__String* pszJson);
	void OnResult_Register(__String* pszJson);
	void OnResult_Fighting(__String* pszJson);
	//void OnResult_FightingInfo(__String* pszJson,SEL_CallFuncND pSelector);
private:
	bool m_bHasResult;
};

